Return the correct value from gtk_notebook_insert_page if the page-added
authorChristian Persch <chpe@cvs.gnome.org>
Tue, 26 Dec 2006 14:49:34 +0000 (14:49 +0000)
committerChristian Persch <chpe@src.gnome.org>
Tue, 26 Dec 2006 14:49:34 +0000 (14:49 +0000)
2006-12-26  Christian Persch  <chpe@cvs.gnome.org>

* gtk/gtknotebook.c: (gtk_notebook_real_insert_page):
Return the correct value from gtk_notebook_insert_page if the
page-added handler reorders the tabs. Bug #345094.

ChangeLog
gtk/gtknotebook.c

index 8006d79e90f46ec36dddedda79567f1a380b0acd..f559d14dd07e4ce50d5a351181bf605f7f0c2ee8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-12-26  Christian Persch  <chpe@cvs.gnome.org>
+
+       * gtk/gtknotebook.c: (gtk_notebook_real_insert_page):
+       Return the correct value from gtk_notebook_insert_page if the
+       page-added handler reorders the tabs. Bug #345094.
+
 2006-12-26  Carlos Garnacho  <carlosg@gnome.org>
 
        Fix small regressions in GtkNotebook tab detaching. Bug #378852.
index 263c040d1cc65c74b451001d5067bbf2d1881c29..85d9953fd1ec9e14c7ea9c7fb0eda96ffae729ec 100644 (file)
@@ -3998,7 +3998,8 @@ gtk_notebook_real_insert_page (GtkNotebook *notebook,
   gtk_widget_child_notify (child, "position");
   gtk_widget_thaw_child_notify (child);
 
-  return position;
+  /* The page-added handler might have reordered the pages, re-get the position */
+  return gtk_notebook_page_num (notebook, child);
 }
 
 /* Private GtkNotebook Functions: